package net.sourceforge.peers.gui;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import net.sourceforge.peers.Logger;

public class CallFrameStateFailed extends CallFrameState {

    public CallFrameStateFailed(String id, CallFrame callFrame, Logger logger) {
        super(id, callFrame, logger);
        callPanel = new JPanel();
        callPanel.add(new JLabel("会话失败"));
        JButton closeButton = new JButton("关闭");
        closeButton.setActionCommand(CallFrame.CLOSE_ACTION_COMMAND);
        closeButton.addActionListener(callFrame);
        callPanel.add(closeButton);
    }

    @Override
    public void closeClicked() {
        callFrame.setState(callFrame.TERMINATED);
        callFrame.close();
    }

}
